﻿using System;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Content.Spritesheet
{
    public class CastleEnvironmentSheet : SpriteSheetInstance
    {
        private static SpriteSheetInstance _instance;
        public static void LoadContent()
        {
            _instance = new CastleEnvironmentSheet();
        }
        public new static Sprite GetSprite(Enum textureName)
        {
            return _instance.GetSprite(textureName);
        }

        public enum BrickWall
        {
            TopLeft = 0,
            Top,
            TopRight,
            Left,
            Center,
            Right,
            BottomLeft,
            Bottom,
            BottomRight,
            TopLeftInward,
            TopRightInward,
            BottomLeftInward,
            BottomRightInward
        }

        public enum StoneHole
        {
            TopLeft = 0,
            Top,
            TopRight,
            Left,
            Center,
            Right,
            BottomLeft,
            Bottom,
            BottomRight,
        }

        public enum StoneFloor
        {
            TopLeft = 0,
            Top,
            TopRight,
            Left,
            Center,
            Right,
            BottomLeft,
            Bottom,
            BottomRight,
            TopLeftInward,
            TopRightInward,
            BottomLeftInward,
            BottomRightInward,
            HallwayLeft,
            HallwayTop,
            HallwayRight,
            HallwayBottom,
            HallwayHorizontal,
            HallwayVertical,
            HallwayEndRight,
            HallwayEndLeft,
            HallwayEndTop,
            HallwayEndBottom,
            
        }

        public override string SpriteSheetPath
        {
            get
            {
                return "Content/Images/CastleEnvironment.png";
            }
        }

        protected override void LoadSprites()
        {
            AddEnumList<BrickWall>(BrickWall.TopLeft, BrickWall.BottomRight, new TE_Rectangle(0, 0, 2, 2), 3);
            
            AddSprite(BrickWall.TopLeftInward, new TE_Rectangle(6, 0, 2, 2));
            AddSprite(BrickWall.TopRightInward, new TE_Rectangle(8, 0, 2, 2));
            AddSprite(BrickWall.BottomLeftInward, new TE_Rectangle(6, 2, 2, 2));
            AddSprite(BrickWall.BottomRightInward, new TE_Rectangle(8, 2, 2, 2));

            AddEnumList<StoneFloor>(StoneFloor.TopLeft, StoneFloor.BottomRight, new TE_Rectangle(10, 0, 2, 2), 3);
            
            AddSprite(StoneFloor.TopLeftInward, new TE_Rectangle(16, 0, 2, 2));
            AddSprite(StoneFloor.TopRightInward, new TE_Rectangle(18, 0, 2, 2));
            AddSprite(StoneFloor.BottomLeftInward, new TE_Rectangle(20, 0, 2, 2));
            AddSprite(StoneFloor.BottomRightInward, new TE_Rectangle(22, 0, 2, 2));

            AddSprite(StoneFloor.HallwayLeft, new TE_Rectangle(16, 2, 2, 2));
            AddSprite(StoneFloor.HallwayTop, new TE_Rectangle(18, 2, 2, 2));
            AddSprite(StoneFloor.HallwayRight, new TE_Rectangle(20, 2, 2, 2));
            AddSprite(StoneFloor.HallwayBottom, new TE_Rectangle(22, 2, 2, 2));
            AddSprite(StoneFloor.HallwayHorizontal, new TE_Rectangle(16, 4, 2, 2));
            AddSprite(StoneFloor.HallwayVertical, new TE_Rectangle(18, 4, 2, 2));
            AddSprite(StoneFloor.HallwayEndLeft, new TE_Rectangle(22, 4, 2, 2));
            AddSprite(StoneFloor.HallwayEndRight, new TE_Rectangle(20, 4, 2, 2));
            AddSprite(StoneFloor.HallwayEndTop, new TE_Rectangle(6, 4, 2, 2));
            AddSprite(StoneFloor.HallwayEndBottom, new TE_Rectangle(8, 4, 2, 2));

            AddEnumList<StoneHole>(StoneHole.TopLeft, StoneHole.BottomRight, new TE_Rectangle(24, 0, 2, 2), 3);
        }
    }
}